import request from '@/api/request'
//运营商资产变更 PREFIX

// 运营商审批
export function commitOrg(data){
  return request({
    url: '/govStatisticalAnalysisAuditService/assetChange/commitOrg',
    method: "post",
    data: data || {}
  })
}


// 运营商申报添加
export function addOrg(data){
  return request({
    url: '/govStatisticalAnalysisAuditService/assetChange/addOrg',
    method: "post",
    data: data || {}
  })
}


// 分页查询运营商申报
export function queryOrgByPage(data){
  return request({
    url: '/govStatisticalAnalysisAuditService/assetChange/queryOrgByPage',
    method: "post",
    data: data || {}
  })
}


  // 谷城新加的根据token过滤地区树
  
  export function getRegionTreeByUserInfo(){
    return request({
      url: '/govStatisticalAnalysis/comm/getRegionTreeByUserInfo',
      method: 'GET'
    })
  }

//模糊查询地区下拉框
export function searchSelects(staName){
  return request({
      url: '/govStatisticalAnalysisAuditService/assetChange/getStaNames?staName='+staName,
      method: 'get',
  })
}
//省市区选择框
export function sxqxzk() {
  return request({
      url: `/system/region/getRegionTree?id=-1`,
      method: 'get',
  })
}
//1.1获取-点击站新建申请按钮
export function getForm(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getInfo",
    method: "post",
    data: data || {}
  });
}
//1.2站新建申请弹框点击右边按钮-根据staid获取详情list
export function getInfo(data){
    return request({
      url: "/govStatisticalAnalysisAuditService/assetChange/getStatInfo/"+data,
      //assetChange/getStatInfo/{stationId}
      method: "post",
      data: data || {}
    });
}

//0.3点击查看添加站充电桩详情
export function getStakeInfoAdd(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getStakeByIdInAdd",
    method: "post",
    data: data || {},
  });
}
//0.4点击查看变更充电枪详情
export function getDevInfoAdd(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getConnByIdInAdd",
    method: "post",
    data: data || {},
  });
}
//1.3资产变更对比页面点击查看变更桩详情
export function getPileDetail(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getStakeByIdInInfo",
    method: "post",
    data: data || {},
  });
}
//1.4资产变更对比点击查看变更枪详情
export function getGunDetail(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getConnByIdInInfo",
    method: "post",
    data: data || {},
  });
}
//2.3点击查看充电桩详情
export function getStakeInfoById(data,id){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getStakeInfoById/"+data+"/"+id,
    //assetChange/getStakeInfoById/{id}/{applicantId}
    method: "post",
    data: data || {},
    id: id || {}
  });
}
//2.4点击查看充电枪详情
export function getConnectorInfoById(data,id){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getConnectorInfoById/"+data+"/"+id,
    //assetChange/getConnectorInfoById/{id}/{applicantId}
    method: "post",
    data: data || {},
    id: id || {}
  });
}


//1.5提交保存新建站申请
export function save(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/save",
    method: "post",
    data: data || {}
  });
}


//2.0获取-点击站变更申请按钮
export function getForms(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getInfoInChange",
    method: "post",
    data: data || {}
  });
}
//2.1变更申请点击站点变更获取
export function getApply(stationId){
    return request({
      url: `/govStatisticalAnalysisAuditService/assetChange/changApplicationObtain/${stationId}`,
      //assetChange/changApplicationObtain/{stationId}
      method: "get"
    });
}
//2.2变更申请弹框-点击获取详情
export function getApplyDetail(id){
  return request({
    url: `/govStatisticalAnalysisAuditService/assetChange/changApplicationInfo/${id}`,
    //assetChange/changApplicationInfo/{applicantId}
    method: "get"
  });
}



// 2.5变更申请提交
export function commitApply(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/changApplicationSubmit",
    method: "post",
    data: data || {}
  });
}






//3.1获取申请单列表
export function getRecordByPage(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getRecordByPage",
    method: "post",
    data: data || {}
  });
}
//3.2列表页面-列表点击查看详情按钮
export function getRecordInfo(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getRecordInfo/"+data,
    //assetChange/getRecordInfo/{applicantId}
    method: "post",
    data: data || {}
  });
}
//3.3详情页的上传附件
export function uploadFile(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/uploadscript",
    method: "post",
    data: data || {},
  });
}
//3.4导出
export function assetChangeexportd(data){
  return request({
    responseType: 'blob',
    url: "/govStatisticalAnalysisAuditService/assetChange/export",
    method: "post",
    data: data || {}
  });
}
//3.5下载
export function downloadFile(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/downloadscript",
    method: "post",
    data: data || {},
    responseType: 'blob'
  });
}



//4.1提交站变更申请审核流程
export function commit(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/commit",
    method: "post",
    data: data || {}
  });
}

export function delRecord(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/delRecord/"+data,
    method: "delete",
    data: data||{}
  });
}

// 点击站 查看站详情
export function getChangeStaInfo(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getChangeStaInfo",
    method: "get",
    params: data || {},
  });
}
// 通过桩id获取枪
export function getConnList(data,id){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getConnList/"+data+'/'+id,
    method: "get",
    data: data || {},
    id:id,
  });
}
// 审核列表接口
export function getRecordByPageOne(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getRecordByPageOne",
    method: "post",
    data: data || {},
  });
}
// 新建 变更前 桩id查枪
export function getConnListByStationIdAndStakeId(data){
  return request({
    url: "/govStatisticalAnalysisAuditService/assetChange/getConnListByStationIdAndStakeId",
    method: "get",
    params: data || {},
  });
}
//运营商树形结构
export function getPowerOrgTreeByUserType(data){
  return request({
    url: "/system/group/getPowerOrgTreeByUserType",
    method: "get",
    params: data || {},
  });
}

